cmake_minimum_required(VERSION 3.2)
project(H2Lib CXX)

add_definitions(-D_UNICODE -DUNICODE -DWIN32 -D_WINDOWS)

set(CompilerFlags
    CMAKE_CXX_FLAGS
    CMAKE_CXX_FLAGS_DEBUG
    CMAKE_CXX_FLAGS_RELEASE
    CMAKE_C_FLAGS
    CMAKE_C_FLAGS_DEBUG
    CMAKE_C_FLAGS_RELEASE
)
foreach(CompilerFlag ${CompilerFlags})
  string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()

include("cmake/ExternalProject.cmake")

set(OUTPUT_INCLUDE_DIR ${PROJECT_BINARY_DIR}/include/H2Lib)

add_subdirectory(${PROJECT_SOURCE_DIR}/src/net)

file(COPY src/datetime.hpp DESTINATION ${OUTPUT_INCLUDE_DIR})
file(COPY src/text.hpp DESTINATION ${OUTPUT_INCLUDE_DIR})
